import time
class character:
    def __init__(self,name,blood,attack,defense,crit):
        self.name = name
        self.blood =blood
        self.attack = attack
        self.defense = defense
        self.crit = crit


        print(name,"Character created successfully")

        print("______    _______")

    def do_attack(self,other):
        print("-----此时双方正在进行交战-----")
        print(self.name,"正在对敌方发起进攻!-->",other.name)
        other.blood =other.blood+other.defense-self.attack
        print(other.name,"还剩下的血量为：",other.blood)

    def do_crit(self,name):
        print("特殊回合，在这回合",self.name,"的攻击产生暴击")
        self.attack = self.attack + self.crit
        print(self.name,"的攻击力成长为",self.attack)

        print("______    _______")

if __name__ == '__main__':
    a=character("奥特曼1号",120,20,15,35)
    b=character("大怪兽1号",120,22,10,25)
    c=character("奥特曼2号",120,20,10,35)
    d=character("大怪兽2号",120,22,15,25)
    while 1:
        a.do_attack(b)
        if b.blood<=0:
            print(b.name,"失败了")
            print("______    _______")
            print("就在这时怪兽阵营的新敌人出现了")
            print("______    _______")
            while 1:
                a.do_crit(a)
                d.do_attack(a)
                if a.blood <= 0:
                    print(a.name,"失败了")
                    print("______    _______")
                    print("就在这时奥特曼阵营的新敌人出现了")
                    print("______    _______")

                    while 1:
                        d.do_crit(d)
                        c.do_attack(d)
                        if d.blood <= 0:
                            print(d.name, "失败了")
                            print(d.name, "大怪兽全体阵营是都失败了")
                            break
                        time.sleep(1)

                        d.do_attack(c)
                        if c.blood <= 0:
                            print(c.name, "奥特曼全体阵营是都失败了")
                            break
                        time.sleep(1)
                    break
                time.sleep(1)

                a.do_attack(d)
                if d.blood <= 0:
                    print(d.name, "大怪兽全体阵营是都失败了")
                    break
                time.sleep(1)
            break
        time.sleep(1)



        b.do_attack(a)
        if a.blood <= 0:
            print(a.name, "失败了")
            print("______    _______")
            print("就在这时奥特曼阵营的新敌人出现了")
            print("______    _______")
            while 1:
                b.do_crit(b)
                c.do_attack(b)
                if b.blood <= 0:
                    print(b.name, "失败了")
                    while 1:
                        c.do_crit(c)
                        d.do_attack(c)
                        if c.blood <= 0:
                            print(c.name, "失败了")
                            print("奥特曼全体阵营是都失败了")
                            break
                        time.sleep(1)

                        c.do_attack(d)
                        if d.blood <= 0:
                            print( "大怪兽全体阵营是都失败了")
                            break
                        time.sleep(1)

                    break
                time.sleep(1)

                b.do_attack(c)
                if c.blood <= 0:
                    print(c.name, "奥特曼全体阵营是都失败了")
                    break
                time.sleep(1)
            break
        time.sleep(1)



